package com.lbj.core.ext

import android.content.Context
import android.net.ConnectivityManager

// 网络是否开启
fun Context.isNetworkAvailable(): Boolean {
    val manager = applicationContext.getSystemService(
        Context.CONNECTIVITY_SERVICE
    ) as ConnectivityManager
    val info = manager.activeNetworkInfo
    return info != null && info.isAvailable
}